package com.example.demo.repository;

import com.example.demo.domian.Comment;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;


//用于操作comment实体类
public interface CommentRepository extends JpaRepository<Comment,Integer> {
    //根据评论id修改评论作者author
    @Modifying//表示当前是更新操作
    @Query("update t_comment c set c.author=?1 where c.id=?2")
    public int updateComment(String author,Integer id);
}
